<?php /* @var $this Controller */ ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/styles.css" />
      <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/styles.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/tables.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />




	<title><?php echo CHtml::encode($this->pageTitle); ?></title>

	<?php Yii::app()->bootstrap->register(); ?>
</head>

<!-- El sigueinte codigo lo que inserta es la imagen favicon.ico a la aplicacion web  -->
<?php
$baseUrl = Yii::app()->request->baseUrl;
$clientScript = Yii::app()->getClientScript();
$clientScript->registerMetaTag("text/html; charset=utf-8",null,"Content-Type");
$clientScript->registerMetaTag("es","language");
$clientScript->registerMetaTag("width=device-width, initial-scale=1.0","viewport");
//$clientScript->registerMetaTag("","author");
$clientScript->registerMetaTag("IE=edge",null,"X-UA-Compatible");

$clientScript->registerLinkTag('shortcut icon', null, $baseUrl . '/images/favicon2.ico');
?>

<body>

<?php /*$this->widget('bootstrap.widgets.TbNavbar',array(
    'items'=>array(
        array(
            'class'=>'bootstrap.widgets.TbMenu',
            'items'=>array(
                array('label'=>'Home', 'url'=>array('/site/index')),
                array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),
                array('label'=>'Contact', 'url'=>array('/site/contact')),
                array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
                array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
            ),
        ),
    ),
)); */?>
<?php $this->widget('bootstrap.widgets.TbNavbar', array(
    'type'=>'inverse', // null or 'inverse'
   'brand'=>'SIÖ',
    'brandUrl'=>'#',
    'collapse'=>true, // requires bootstrap-responsive.css
    'items'=>array(
        array(
            'class'=>'bootstrap.widgets.TbMenu',
            'items'=>array(
                //array('label'=>'Inicio','icon'=>'home', 'url'=>array('/site/index'), 'active'=>false,'visible'=>Yii::app()->user->isGuest),
               array('label'=>'Usuarios','icon'=>'user','url'=>array('/usuarios/admin'), 'active'=>false,'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Administrador')),  
                array('label'=>'Proveedores','icon'=>'folder-close', 'url'=>array('/proveedor/admin'),'active'=>false,'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Administrador') || Yii::app()->user->checkAccess('Proveeduría')),
                array('label'=>'Bodegas','icon'=>'inbox','url'=>array('/bodegas/admin'),'active'=>false,'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Administrador') || Yii::app()->user->checkAccess('Proveeduría')/*|| Yii::app()->user->checkAccess('Adm_Bodega')*/),
                array('label'=>'Inventario','icon'=>'shopping-cart','url'=>'#', 'active'=>false,'visible'=>!Yii::app()->user->isGuest, 'items'=>array(
                  array('label'=>'Catálogo','icon'=>'share','url'=>array('/catalogo/admin'),'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Administrador')),
                     array('label'=>'Bodega Satélite','icon'=>'briefcase','url'=>array('/bodegaSateliteUser/admin'),'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Adm_Bodega')),
                     array('label'=>'Bodega Satélite','icon'=>'briefcase','url'=>array('/bodegaSatelite/admin'),'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Administrador') || Yii::app()->user->checkAccess('Proveeduría')),//arregue esto.
                )),
                array('label'=>'Servicios','icon'=>'book','url'=>array('/servicios/admin'),'active'=>false,'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Administrador')|| Yii::app()->user->checkAccess('Adm_Bodega')),
                array('label'=>'Ajustar inventario','icon'=>'edit','url'=>array('/ajuste/index'),'active'=>false,'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Administrador')),
                array('label'=>'Bitácora','icon'=>'list-alt','url'=>array('/bitacora/admin'),'active'=>false,'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Administrador')|| Yii::app()->user->checkAccess('Proveeduría')),
                array('label'=>'Reportes','icon'=>'print','url'=>array('/begin/reportes'),'active'=>false,'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Administrador')|| Yii::app()->user->checkAccess('Proveeduría')),
                array('label'=>'Reportes','icon'=>'print','url'=>array('/begin/reportes2'),'active'=>false,'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Adm_Bodega')),
                array('label'=>'Respaldos','icon'=>'download-alt','url'=>array('/backup'),'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Administrador')),

               // array('label'=>'Iniciar Sesión', 'url'=>array('/site/login')),
               // array('label'=>'Cerrar ('.Yii::app()->user->name.')','icon'=>'remove','url'=>array('/site/logout'),'active'=>true,'visible'=>!Yii::app()->user->isGuest)
           
            ),

        ),
        array(
            'class'=>'bootstrap.widgets.TbMenu',
            'htmlOptions'=>array('class'=>'pull-right'),
            'items'=>array(
            array('label'=>''.Yii::app()->user->name.'','icon'=>'#','url'=>'#', 'active'=>false,'visible'=>!Yii::app()->user->isGuest, 'items'=>array(
                    array('label'=>'Cambiar contraseña','icon'=>'user','url'=>array('/usuarios/change'),'active'=>false,'visible'=>!Yii::app()->user->isGuest && Yii::app()->user->checkAccess('Administrador') || Yii::app()->user->checkAccess('Proveeduría')|| Yii::app()->user->checkAccess('Adm_Bodega')),
                    array('label'=>'Cerrar sesion','icon'=>'remove','url'=>array('/site/logout'),'visible'=>!Yii::app()->user->isGuest),
                     
                )),
            ),
        ),
    ),
)); ?>
<div class="container" id="page">

	<?php /*if(isset($this->breadcrumbs)):?>
		<?php $this->widget('bootstrap.widgets.TbBreadcrumbs', array(
			'links'=>$this->breadcrumbs,
		)); ?><!-- breadcrumbs -->
	<?php endif*/?>


<!-- Se utiliza para mostrar mensajes al usuario  NelGamb -->
<?php if(($msj=Yii::app()->user->getFlashes())!==null):?>
<div class="container">
<div class="row-fluid">
<div class="span12">
<?php foreach ($msj as $type => $message):?>
<div class="alert alert-<?php echo $type?>">
 <button type="button" class="close" data-dismiss="alert">&times;</button>
 <strong><?php echo ucfirst($type)?>!</strong> 
 <?php echo $message?>
</div>
<?php endforeach?>
<?php endif?>
</div>
</div>
</div>
<!-- Se utiliza para mostrar mensajes al usuario  NelGamb -->


	<?php echo $content; ?>

	<div class="clear"></div>

	<div id="footer">
		<div id="sio" > </div> 
        <div id="ccss" > </div>
        Copyright &copy; <?php echo date('Y'); ?> Proyecto SIÖ.<br/>
        Todos los derechos reservados.<br/>
        Proyecto de Ingeniería en Sistema de Información, UNA. 
	</div><!-- footer -->

</div><!-- page -->

</body>
</html>
